<?php
/**
 *  view: edit_gallery_items (part view)
 *  file: profile/part/edit_gallery_items.php
 */

?>

        
          
            <?php
            if( count($images)>0 )
            {
              
              $i=0;
              foreach ($images as $row)
              {
                $i++;
                $checked = (1 == $row->main)?"checked='checked'":"";
                echo "
                  <div class='image'><a class='group1' href='".base_url()."profile/image/big/{$row->user_id}/{$row->name}' title='".$this->session->userdata('username')."-".$i."' ><img src='".base_url()."profile/image/thumb/{$row->user_id}/{$row->name}' alt='".$this->session->userdata('username')."-".$i."' ></a>
            <input name='user-id' type='radio' {$checked} value='{$row->id}' alt='{$row->user_id}/{$row->name}' onclick=\"set_profile_img({$row->id})\" ><span>".lang('profil')."</span>
            <a href='javascript:delete_img({$row->id})' class='delete-img confirmLink' name='' title='".lang('delete_photo')."' alt='".lang('confirm_delete_photo')."' ></a>
            ";
            //<input class='delete-img' name='' onclick=\"delete_img({$row->id},'".lang('are_you_sure')."?')\" type='button'>
            // Samo admin moze da lock/unlock image
            //if( $this->session->userdata('admin_logged') )
            //{
              if( $row->private )
                echo "<input class='lock' onclick=\"lock_unlock_img({$row->id})\"  name='' type='button'>";
              else
                echo "<input class='unlock' onclick=\"lock_unlock_img({$row->id})\"  name='' type='button'>";
            //}
            //else
            //{
            //  if( $row->private )
            //    echo "<input class='lock'  name='' type='button'>";
            //  else
            //    echo "<input class='unlock' name='' type='button'>";
            //}
            
            echo "
              </div><!--end image-->
                  ";
              }
            }            
            ?>   
        
        <script>
			$(document).ready(function(){
                // Colorbox
				$(".group1").colorbox({rel:'group1'});                
			});
		</script>
        <script src="<?php echo base_url(); ?>js/dialog.js"></script>